"""
@author: Sergiy Tsymbalyuk
"""

from pylons import request

from chowa.lib.base import render, Session
from chowa.model.navigation import HomepageBlockLink


class HomepageLinks(object):
    def __init__(self, options={}):
        self.options = options
    
    def render(self):
        block_id = self.options.get('id')
        links = Session.query(HomepageBlockLink).filter_by(block_id=block_id)
        return render('/layout/homepage_links.html', extra_vars={'links':links})
